#ifndef CATMULL
#define CATMULL

#ifdef WIN32
#include <Windows.h>
#endif

#include "Vector3.h"
#include <math.h>
#include <vector>
#include <iostream>
#include <fstream>
#include <GL/glew.h>

using namespace std;

struct controlPoint {
	float time;
	Vec3 pos;
};

class catmullCurve
{
	public:
		catmullCurve();
		~catmullCurve();
		bool parse(const char *file);
		Vec3 animate(float t);
		Vec3 getCurrentPos();
		void draw();
		

	private:
		void rescaleTime();
		void evalpos(float dt);
		unsigned int findspan(float t);
		vector<controlPoint> cpoints;
		float currenttime;
		Vec3 currentpos;
		float totalTime;
		GLuint displist;
		
};


#endif
